package UnitTest.AlgorithmTest.combineTest.sumofSubSequenceTest.LMGTest;

import Algorithm.comprehensive.sumofSubSequence.LMG.ThiefSteal2;
import org.junit.Test;

/**
 * @author liujun
 * @version 1.0
 * @date 2021/1/26
 * @author—Email liujunfirst@outlook.com
 * @blogURL https://blog.csdn.net/ljfirst
 * @description 打家劫舍2 测试案例
 */
public class ThiefSteal2Test {

    ThiefSteal2 thiefSteal2 = new ThiefSteal2();

    @Test
    public void test() {
        int taregt = thiefSteal2.method(demo01);
        assert taregt == 210;
        taregt = thiefSteal2.method(demo02);
        assert taregt == 30;
        taregt = thiefSteal2.method(demo03);
        assert taregt == 210;
        taregt = thiefSteal2.method(demo04);
        assert taregt == 105;
        taregt = thiefSteal2.method(demo05);
        assert taregt == 105;
        taregt = thiefSteal2.method(demo06);
        assert taregt == 630;
        taregt = thiefSteal2.method(demo07);
        assert taregt == 126;
    }

    int[] demo01 = {5, 2, 6, 3, 1, 7};       //210
    int[] demo02 = {5, 2, 6, 3, 1, -7};      //30
    int[] demo03 = {5, 2, -6, 3, 1, -7};     //210
    int[] demo04 = {5, 2, -6, 3, 1, 7};      //105
    int[] demo05 = {5, 2, -6, 0, 3, 1, 7};   //105
    int[] demo06 = {-5, 2, -6, 0, 3, 1, 7};  //630
    int[] demo07 = {-5, 2, -6, 0, 3, 1, -7}; //126
}
